/*
	 blog view page
	 */
(function(){
	var _ns_index = ns('index'), 
			_util = ns('util'),
			__shadow_template = '<div class="blog-width shadow bg1">{c}</div>';


	deps('util');
	_ns_index.initialize = function() {
		$.post('blog/action/list/0/10', function(_ids) { __on_blog_list(eval(_ids)); });
	}
	function __on_blog_list(_ids) {
		var _id;
		if (_ids.length > 0) {
			_id = _ids.shift();
			$.post(_util.format('blog/action/view/{0}', _id), __on_blog.bind({remain:_ids, id:_id}));
		}
	}
	function __on_blog(_blog) {
		$('#content-lan').append(
			_util.format(__shadow_template, eval('('+_blog+')'))
		);
		if (this.remain.length > 0) { 
			__on_blog_list(this.remain); 
		}
	}
})();

